﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcVehicleInsurance.Models;

namespace MvcVehicleInsurance.Controllers
{
    public class AccountLoginController : Controller
    {

        private DataClassesVehicleDataContext dc = new DataClassesVehicleDataContext();
        //
        // GET: /AccountLogin/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult Login()
        {
            return View();
        }
        public ActionResult XulyDangnhap(string Username, string Password)
        {
            string x = string.Empty;
            AccountLoginModels acm = new AccountLoginModels();
            if(acm.DangNhap(Username,Password))
            {
                x = "Index";
                Session["Username"] = Username;

            }
            else
            {
                x = "Login";
                ViewData["message"] = "Not connect";
            }
            return View(x);
        }

    }
}
